package spring.cloud.service.task.dto;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;

@Slf4j
@Setter
@Getter
public class ZooKeeperDto {
    protected String status;//设置N代表则不再接入新的命名空间
    private long id;
    private String createdBy;
    private Date createTime;
    private String lastUpdatedBy;
    private Date lastUpdateTime;
    //
    private String description;
    private String zooKeeperKey;
    private String addressList;
    private String digest;

    public spring.cloud.service.task.domain.zooKeeperAndNamespace.ZooKeeper copy() {
        spring.cloud.service.task.domain.zooKeeperAndNamespace.ZooKeeper zooKeeper = new spring.cloud.service.task.domain.zooKeeperAndNamespace.ZooKeeper();
        zooKeeper.setId(id);
        zooKeeper.setCreatedBy(createdBy);
        zooKeeper.setCreateTime(createTime);
        zooKeeper.setLastUpdatedBy(lastUpdatedBy);
        zooKeeper.setLastUpdateTime(lastUpdateTime);
        //
        zooKeeper.setDescription(description);
        zooKeeper.setZooKeeperKey(zooKeeperKey);
        zooKeeper.setAddressList(addressList);
        zooKeeper.setDigest(digest);
        zooKeeper.setStatus(status);
        zooKeeper.updateStatusFlag();
        //
        zooKeeper.setOnline(true);//这只是mock
        return zooKeeper;
    }
}
